﻿using PetaPoco;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TestPetaPoco.Common;
using TestPetaPoco.Models;

namespace TestPetaPoco.Controllers
{
    public class UserController : BaseController<IUserInfoService>
    {
        //
        // GET: /User/
        public ActionResult Index()
        {
            TestDAO t = new TestDAO();
            t.PageList(1, 10, new List<ScriptSearch>(), null);
            return View();
        }
        public string Index(long pageIndex, long pageSize, string orderBy, string search)
        {
            Func<ResponseModel> funcAction = () =>
            {
                var responseModel = new ResponseModel();
                responseModel.Data = Service.PageTable(pageIndex, pageSize, GetScriptSearch(search), orderBy).JsonPage();
                return responseModel;
            };
            return ActionResponseGetString(funcAction);
        }
	}
}